﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ListAdmin.aspx.cs" Inherits="EmployeeCheckIn.ListAdmin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            width: 93%;
            height: 91px;
        }
        .style9
        {
            height: 28px;
            padding: 20px;
        }
        .style11
        {
            height: 10px;
        }
        .style12
        {
            width: 27px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table class="style1" align="center">
        <tr>
            <td align="left" class="style9">
                <asp:Label ID="Label1" runat="server" Font-Size="Large" Text="รายชื่อ" ForeColor="Black"></asp:Label>
            </td>
        </tr>
        <tr>
            <td align="center" class="style11">
                <table style="width: 100%;">
                    <tr>
                        <td class="style12">
                            &nbsp;
                        </td>
                        <td>
                            <asp:Label ID="Label2" runat="server" Text="จากวันที่สมัคร :"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtStDate" runat="server" class="dateInput" Height="24px" Width="140px"
                                onfocus="javascript: if(this.value != 'A new value'){ this.value = ''; }" onblur="javascript: if(this.value==''){this.value='';}"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Label ID="Label3" runat="server" Text="ถึง"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtEnDate" runat="server" class="dateInput" Height="24px" Width="140px"
                                onfocus="javascript: if(this.value != 'A new value'){ this.value = ''; }" onblur="javascript: if(this.value==''){this.value='';}"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Label ID="Label_sert" runat="server" Text="Username / ชื่อ"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtNameAdmin" runat="server" Height="24px" Width="140px" onfocus="javascript: if(this.value != 'A new value'){ this.value = ''; }"
                                onblur="javascript: if(this.value==''){this.value='';}"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="ค้นหา" Width="50px" />
                        </td>
                    </tr>
                    <tr>
                        <td class="style12">
                            &nbsp;
                        </td>
                        <td>
                            <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="เพิ่ม Admin" />
                        </td>
                        <td align="center" colspan="5">
                            <asp:Label ID="lbNotFound" runat="server" ForeColor="Red" Text="-----ไม่พบข้อมูลการค้นหา-----"
                                Visible="False"></asp:Label>
                            <asp:Label ID="lbWarn" runat="server" ForeColor="Red" Text="กรุณากรอกวันเริ่มต้นและสิ้นสุด"
                                Visible="False"></asp:Label>
                        </td>
                        <td>
                            <asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text="Export Excel" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="center">
                <br />
                <asp:GridView ID="gvAdminDetail" CssClass="gv" runat="server" Width="100%" AutoGenerateColumns="False"
                    CellPadding="3" OnRowCommand="gvAdminDetail_RowCommand" OnRowCreated="gvAdminDetail_RowCreated"
                    EnableModelValidation="True" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None"
                    BorderWidth="1px">
                    <Columns>
                        <asp:BoundField DataField="user_name" HeaderText="Username" />
                        <asp:BoundField DataField="admin_name" HeaderText="ชื่อ" />
                        <asp:BoundField DataField="admin_lastname" HeaderText="นามสกุล" />
                        <asp:BoundField DataField="admin_date_regis" HeaderText="วันที่สมัคร" >
                        <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField DataField="admin_date_edit" HeaderText="วันที่แก้ไข" >
                        <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField DataField="update_by" HeaderText="แก้ไขโดย" />
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:ImageButton ID="ibtDetail" CommandName="cmdDetail" ToolTip="ดูข้อมูล" CommandArgument='<%#Eval("admin_id") %>'
                                    runat="server" ImageUrl="~/Immages/icon/folder_blue_explorer.png" Style="margin-left: 1px"
                                    Height="25px" Width="25px" />
                                &nbsp;<asp:ImageButton ID="ibtEdit" CommandName="cmdEdit" ToolTip="แก้ไขข้อมูล" CommandArgument='<%#Eval("admin_id") %>'
                                    runat="server" ImageUrl="~/immages/icon/edit.png" Height="25px" Width="25px" />
                                &nbsp;<asp:ImageButton ID="ibtDelete" CommandName="cmdDelete" ToolTip="ลบข้อมูล"
                                    CommandArgument='<%#Eval("admin_id") %>' runat="server" OnClientClick="return confirm('ยืนยันการลบข้อมูล?')"
                                    ImageUrl="~/immages/icon/button_cancel.png" Height="25px" Width="25px" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="White" ForeColor="#000066" />
                    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                    <RowStyle ForeColor="#000066" />
                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                </asp:GridView>
                <br />
                <br />
                <br />
            </td>
        </tr>
        <tr>
            <td align="left" class="style9">
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>
